package com.sl.plugin.step.db;

import com.sl.core.engine.meta.ProcessCompDescriptorService;
import com.sl.core.engine.meta.impl.AbstractProcessCompDescriptor;
import com.sl.core.engine.meta.row.ProcessRowDescriptor;
import lombok.Getter;
import org.apache.hop.core.row.value.ValueMetaInteger;
import org.apache.hop.core.row.value.ValueMetaString;
import org.apache.hop.core.row.value.ValueMetaTimestamp;

/**
 *
 */
@Getter
public class DbDefaultValueCompDescriptor extends AbstractProcessCompDescriptor<
        DbDefaultValueComp, DbDefaultValueContext> implements ProcessCompDescriptorService {


    @Override
    public ProcessRowDescriptor getResultDescriptor(ProcessRowDescriptor rowDescriptor) {

        ValueMetaString valueMetaString = new ValueMetaString("createBy");
        valueMetaString.setComments("创建人");
        rowDescriptor.addValueMeta(valueMetaString);

        valueMetaString = new ValueMetaString("modifyBy");
        valueMetaString.setComments("修改人");
        rowDescriptor.addValueMeta(valueMetaString);

        ValueMetaTimestamp valueMetaTimestamp = new ValueMetaTimestamp("createTime");
        valueMetaTimestamp.setComments("创建时间");
        rowDescriptor.addValueMeta(valueMetaTimestamp);
        valueMetaTimestamp = new ValueMetaTimestamp("modifyTime");
        valueMetaTimestamp.setComments("修改时间");
        rowDescriptor.addValueMeta(valueMetaTimestamp);

        ValueMetaInteger modifyTime = new ValueMetaInteger("deleted");
        modifyTime.setComments("是否删除1是0否");
        rowDescriptor.addValueMeta(modifyTime);
        valueMetaString = new ValueMetaString("remark");
        valueMetaString.setComments("备注");
        rowDescriptor.addValueMeta(valueMetaString);
        return new ProcessRowDescriptor(
                rowDescriptor
        );
    }

}
